﻿package game {
	import flash.display.StageScaleMode;
	import flash.display.StageAlign;
	import flash.display.StageQuality;
	import flash.text.TextFormat;
	import game.socket.Sockets;
	import game.account.header.HSliderEvent;
	import game.objects.*;
	import game.socket.SocketObject;
	import game.lang.Lang;
	import game.debug.Debug;
	
	public class Config {
		
		public var compile:CompileObject		= new CompileObject		( '0.0.1', Lang.RU, false );
		public var server:ServerObject			= new ServerObject;
		public var me:MeObject					= new MeObject;
		public var autoUtil:AutoUtilObject		= new AutoUtilObject;
		public var vkdesktopapi:DesktopVKObject	= new DesktopVKObject	( '3604836', 'friends', DesktopVKObject.DISPLAY_TOUCH );
		public var fbdesktopapi:DesktopFBObject	= new DesktopFBObject	( '102778386445068', 'user_about_me,user_photos,manage_friendlists', DesktopFBObject.DISPLAY_TOUCH );
		public var friends:FriendsObject		= new FriendsObject		( 1, 'lib/emptyFriends.png' );
		public var dirs:DirObject				= new DirObject			( 'lib/models/', 'lib/textures/', '', '' );
		public var skins:Vector.<DynamicObject> = new Vector.<DynamicObject>;
		public var policy:SocketObject			= new SocketObject		( Sockets.POLICY, '192.168.1.33', 55555 );
		public var hslider:Array				= [HSliderEvent.BUY_AUTO, HSliderEvent.BUY_DONAT]; //массив классов с кнопками для headera
		
		
		public static const BUTTONS_CLASS_DIR:String		= "game.buttons.";
		
		public var sockets:Array = [
			new SocketObject ( Sockets.LOGIN,	'192.168.1.33', 33333 ),
			new SocketObject ( Sockets.SHOP,	'192.168.1.33', 8888 )
		];
		
		
		public var lang:Object = {
			'ru': 'ru/nfs_ru.xml',
			'en': 'en/nfs_en.xml'
		}
		
		public var libs:Array = [
			new LibObject ( 'match',	'match.swf' )
		];
		
		public var host:String = "";
		
		public var quality:String = StageQuality.BEST;
		
		public var debug:Array = [
			Debug.API,
			Debug.SOCKET,
			Debug.ACCOUNT,
			Debug.MODELS,
			Debug.HELP,
			//Debug.DYNAMIC_OBJECTS,
			Debug.INTERFACE
		];
								  
		public var defaultTextFormat:TextFormat = new TextFormat ("Tahoma", 13, 0x111111, false, false);
		
		public var stage:Object = {
			color:		0x000000,
			frameRate:	40,
			scaleMode:	StageScaleMode.NO_SCALE,
			align:		StageAlign.TOP_LEFT,
			quality:	StageQuality.BEST
		}
		
		public var hideBeginAlpha:Number = 0.3;	//затемнения динамичных окон
		public var hideRemoveSecs:Number = 3;	//сек через сколько ошибка будет удалена
		public var updateDynamic:Number = 0.5;	//сек через сколько обновлять динамическое окно
		
		public static const EXPIRES_MAX:Number		= 1*60*60*24;
		
		public static const FB_URL_AUTH:String		= "https://graph.facebook.com/oauth/authorize";
		public static const FB_REDIRECT:String		= "http://www.facebook.com/connect/login_success.html";
		public static const FB_API:String			= "https://graph.facebook.com/";
		public static const FB_APP_ID:String		= "1";
		
		public static const VK_URL_AUTH:String		= "https://oauth.vk.com/authorize";
		public static const VK_REDIRECT:String		= "https://oauth.vk.com/blank.html";
		public static const VK_API:String			= "https://api.vk.com/method/";
		public static const VK_API_LOCAL:String		= "http://api.vkontakte.ru/api.php";
		
		public function getSkin(type:String):DynamicObject {
			var obj:DynamicObject;
			for each (var d:DynamicObject in skins) {
				if (d.type==type) {
					obj = d;
					break;
				}
			}
			return obj;
		}
		
		public function Config():void {
			
		}
	}
}